//
//  LCTaskPageTitleCell.m
//  lechuang
//
//  Created by Mr_hi on 2023/4/11.
//  Copyright © 2023 Mooyi. All rights reserved.
//

#import "LCTaskPageTitleCell.h"

@interface LCTaskPageTitleCell ()

@property (nonatomic, strong) UIButton *tagView;

@end

@implementation LCTaskPageTitleCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initCustomCell];
    }
    return self;
}

- (void)initCustomCell {
    //隐藏父视图中的label
    self.textLabel.hidden = YES;
    
    self.tagView = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.tagView setBackgroundImage:[UIImage imageNamed:@"lc_task_btn_bg"] forState:UIControlStateNormal];
    [self.tagView setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.tagView setBackgroundImage:[UIImage imageNamed:@"lc_task_btn_bg_set"] forState:UIControlStateSelected];
    self.tagView.titleLabel.font = [UIFont systemFontOfSize:12];
    self.tagView.userInteractionEnabled = NO;
    [self.contentView addSubview:self.tagView];
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.tagView.frame = CGRectMake(0, 7, self.bounds.size.width, 26);
}

- (void)setTitle:(NSString *)title {
    [self.tagView setTitle:title forState:UIControlStateNormal];
}

- (void)configCellOfSelected:(BOOL)selected {
    self.tagView.selected = selected;
}

//通过此父类方法配置cell动画
- (void)showAnimationOfProgress:(CGFloat)progress type:(XLPageTitleCellAnimationType)type {
}


@end
